to select ↑↓ to navigate
Manufacturing

Manufacturing

Open in ChatGPT
Ask ChatGPT about this page
Open in Claude
Ask Claude about this page

Workstation List View Customization - User Manual

Workstation List View Customization - User Manual

1. Overview

The Workstation List View Customization in ERPNext enhances the Workstation List Page by displaying visual status indicators and additional fields. This allows users to quickly understand workstation conditions at a glance, improving efficiency and workflow visibility.

2. Key Features

  • Custom Status Indicators: Color-coded status labels visually distinguish workstation states.
  • Additional Fields in List View: Displays status without opening individual records.
  • Enhanced Visibility: Enables users to manage workstations more efficiently.

3. Pre-Requisites

Before implementing this customization, ensure:

  • ERPNext and Frappe framework are installed and running.
  • Workstation Module is active.
  • User has sufficient permissions to modify Frappe list view settings.

4. Step-by-Step Usage

Step 1: Understanding the Code

The frappe.listview_settings["Workstation"] customization includes:

frappe.listview_settings["Workstation"] = {
	add_fields: ["status"],  // Displays "status" in the list view
	get_indicator: function (doc) {
		let color_map = {
			Production: "green",
			Off: "gray",
			Idle: "gray",
			Problem: "red",
			Maintenance: "yellow",
			Setup: "blue",
		};
		return [__(doc.status), color_map[doc.status], true];
	},
};
  • add_fields: ["status"] → Ensures that the workstation’s status appears in the list view.
  • get_indicator: function(doc) → Defines color-coded indicators for different workstation statuses.

Step 2: Implementing the Code

  1. Locate the Custom Script Directory

    • Navigate to:
      apps/erpnext/erpnext/manufacturing/doctype/workstation/
      
    • Open workstation_list.js or create a new file if it doesn’t exist.
  2. Paste the Code

    • Copy and paste the above JavaScript code into the workstation_list.js file.
  3. Deploy Changes

    • If using developer mode, run:
      bench build
      
    • Reload the ERPNext instance to see the updates.

Step 3: Testing the Changes

  1. Go to Manufacturing → Workstations.
  2. The Workstation List View should now display colored indicators beside each workstation’s status.

5. Script Customizations

You can modify the code to:

  • Add More Fields: Include additional properties (e.g., workstation_type, hour_rate):
    add_fields: ["status", "workstation_type", "hour_rate"],
    
  • Change Colors: Modify the color_map to customize status colors:
    let color_map = {
        Production: "blue",
        Off: "black",
        Idle: "orange",
        Problem: "maroon",
        Maintenance: "purple",
        Setup: "cyan",
    };
    
  • Add More Statuses: If your system has additional custom statuses, include them in the color_map.

6. Troubleshooting (Common Errors and Resolutions)

Error Cause Solution
Status color is not showing get_indicator function not defined correctly Ensure code is pasted in workstation_list.js
List view not updating Cache issue Run bench build && bench restart, then clear browser cache
Status is not appearing in the list view add_fields does not include "status" Add "status" in add_fields

7. User Roles and Permissions

  • System Manager: Can edit the script and modify workstation settings.
  • Manufacturing User: Can view and manage workstation statuses.
  • Read-Only Users: Can see indicators but cannot modify settings.

8. Key Notes

  • This customization is client-side and does not affect backend logic.
  • Make sure to test in a staging environment before deploying to production.
  • If using custom workstations, update the color_map to include new statuses.

This manual provides a comprehensive guide to customizing Workstation List View in ERPNext. For further assistance, contact your ERPNext Administrator.

Last updated 4 days ago
Was this helpful?
Thanks!